<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">
</head>
<body>

<div class="bs-example" data-example-id="hoverable-table">
    <table class="table table-hover">
        <thead>
        <tr>
            <th>#序号</th>
            <th>位置</th>
            <th>时间</th>
            <th>上传机器</th>
            <th>是否处理</th>
        </tr>
        </thead>
        <tbody>
        {% for position in query_position %}
            <tr>
                <th scope="row">{{ forloop.counter }}</th>
                <td>({{ position.x }},{{ position.y }})</td>
                <td>{{ position.create_time }}</td>
                <td>{{ position.upload }}</td>
                <td><a
                        href="{% url 'delete_operation' pk=position.id %}">
                    {% if position.is_show %} <span style="color: red">未捡起</span>
                    {% else %}<span style="color: #00ee00">已捡起</span>{% endif %}</a>
                </td>
            </tr>
        {% endfor %}

        </tbody>
    </table>
    <nav aria-label="..." style="float: right">
        <ul class="pagination">
            {{ page_html }}
        </ul>
    </nav>

</div>


<script src="{% static 'bootstrap/jquery-3.4.1.min.js' %}"></script>
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<script>

    $(function () {
// 刷新网址
        push_all();
    })

    function push_all() {
        // 定时器刷新

        setInterval(function () {
            window.location.href == location.reload()
        }, 3000)
    }
</script>
</body>
</html>